package chi_example_java;

public class Movie {
	public static final int REGULAR = 0;
	public static final int CHILDREN = 1;
	public static final int NEW_RELEASE = 2;
	
	private String _title;
	private Price _price;
	
	public Movie(String title, int priceCode) {
		_title = title;
		switch (priceCode) {
		case REGULAR:
			_price = new RegularPrice();
			break;
		case CHILDREN:
			_price = new ChildrenPrice();
			break;
		case NEW_RELEASE:
			_price = new NewReleasePrice();
		default:
			break;
		}
	}
	
	public void setTitle(String title) {
		_title = title;
	}
	
	public String getTitle() {
		return _title;
	}
	
	public double getCharge(int daysRented) {
		return _price.getCharge(daysRented);
	}
	
	public int getFrequentRenterPoints(int daysRented) {
		return _price.getFrequentPoints(daysRented);
	}

}
